The use of a cache with a processor reduces memory access time and increases the overall speed of a device. Typically, a cache is an area of memory which serves as a temporary storage area for a device. Data frequently accessed by the processor remain in the cache after an initial access and subsequent accesses to the same data may be made to the cache.
When the processor refers to a memory and finds the data in the cache, it is said to produce a hit. Otherwise, when the data is not in the cache but in the memory, a miss occurs. If a miss occurs, an allocation may be made to place the data into the cache for later accesses. Here, an access can be for loading data to the processor or for storing data from the processor to a memory. The cached information is retained by the cache until it is no longer needed, made invalid or replaced by other data, in which instances the cache entry is de-allocated.
In particular, for mass storage devices, the size of a memory is significantly larger than the amount of space available in a cache so that the cache eventually becomes full. When the cache is full, it is necessary to replace or de-allocate existing lines of stored data in the cache memory to make room for newly requested lines of data.